//编译
fs = require('fs');
src = fs.readFileSync("Attack.sol", 'utf8');

var input = {
    language: 'Solidity',
    sources: {
        'Attack.sol': {
            content: src
        },
        'MemoryStore.sol': {
            content: src
        }
    },
    settings: {
        outputSelection: {
            '*': {
                '*': ['*']
            }
        }
    }
};

solc = require('solc');

out = solc.compile(JSON.stringify(input));
outObj = JSON.parse(out);
// console.log(outObj);

abi = outObj.contracts['Attack.sol']['Attack'].abi;
bytecode = outObj.contracts['Attack.sol']['Attack'].evm.bytecode.object;

module.exports = {
    abi: outObj.contracts['Attack.sol']['Attack'].abi,
    bytecode: outObj.contracts['Attack.sol']['Attack'].evm.bytecode.object
}